import schedule
from datetime import datetime
import time

from apscheduler.executors.pool import ThreadPoolExecutor, ProcessPoolExecutor
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.schedulers.blocking import BlockingScheduler

# .strftime('%Y-%m-%d %H:%M:%S')
a = 0
b = 0
def job():
    print('a')
    s = datetime.now()
    print(datetime.now())
    time.sleep(2)

def jobt():
    print('b')
    print(datetime.now())
    time.sleep(2)

job_defaults = {'max_instances': 1}
scheduler = BlockingScheduler(job_defaults=job_defaults)
scheduler.add_job(jobt, 'interval',seconds=5)
scheduler.add_job(job, 'interval',seconds=5)
scheduler.start()

while True:
    time.sleep(2)
